{"componentChunkName":"component---src-templates-blog-post-js","path":"/Today I Learned/RXJS_of()/","result":{"data":{"site":{"siteMetadata":{"title":"JULog","author":"[Ju Chan Hwang]","siteUrl":"https://julog.netlify.app","comment":{"disqusShortName":"","utterances":"JuChanHwang/gatsby-starter-bee"},"sponsor":{"buyMeACoffeeId":"jbee"}}},"markdownRemark":{"id":"1028c1e3-6bef-5d0b-bbfb-8c37d94b9fbf","excerpt":"of operator ⇒ 인수를 연속적인 observable 형태로 변환한다 EX) emitting an object, array, and function Each argument becomes a next notification. https://rxjs.dev/assets/images/marble-diagrams/of.png","html":"<h2 id=\"of-operator\" style=\"position:relative;\"><a href=\"#of-operator\" aria-label=\"of operator permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>of operator</h2>\n<p>⇒ 인수를 연속적인 observable 형태로 변환한다</p>\n<p>EX) emitting an object, array, and function</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">  // RxJS v6+\n  import { of } from 'rxjs';\n  //emits values of any type\n  const source = of({ name: 'Brian' }, [1, 2, 3], function hello() {\n    return 'Hello';\n  });\n  \n  const subscribe = source.subscribe(val => console.log(val));\n  //output: {name: 'Brian'}, [1,2,3], function hello() { return 'Hello' }\n\n  import { of } from 'rxjs';\n   \n  of(10, 20, 30)\n  .subscribe(\n    next => console.log('next:', next),\n    err => console.log('error:', err),\n    () => console.log('the end'),\n  );\n  // result:\n  // 'next: 10'\n  // 'next: 20'\n  // 'next: 30'</code></pre></div>\n<blockquote>\n<p>Each argument becomes a next notification.</p>\n</blockquote>\n<p><img src=\"https://rxjs.dev/assets/images/marble-diagrams/of.png\" alt=\"https://rxjs.dev/assets/images/marble-diagrams/of.png\"></p>","frontmatter":{"title":"RXJS of()","date":"November 20, 2019"}}},"pageContext":{"slug":"/Today I Learned/RXJS_of()/","previous":{"fields":{"slug":"/Today I Learned/반응형_폼_유효성검사/"},"frontmatter":{"title":"반응형 폼 유효성 검사","category":"Today I Learned","draft":false}},"next":{"fields":{"slug":"/Today I Learned/클래스와_인터페이스/"},"frontmatter":{"title":"클래스와 인터페이스","category":"Today I Learned","draft":false}}}},"staticQueryHashes":["3128451518","96099027"]}